<template>
  <div class="order-review-list">
    <order-review-list-item v-for="review in reviews" :key="review.id" :review="review"/>
  </div>
</template>

<script>
import { order } from "@mall/api-services"
import OrderReviewListItem from "@/components/order/OrderReviewListItem"

export default {
  name: "OrderReviewList",
  components: { OrderReviewListItem },
  data() {
    return {
      reviews: [],
    }
  },
  created() {
    this.refreshReviews()
  },
  methods: {
    refreshReviews() {
      order.OrderReviewServiceV1
          .createOrderReviewQuery()
          .list()
          .then(pageReviews => this.reviews = pageReviews.elements)
    },
  },
}
</script>

<style lang="scss" scoped>
.order-review-list {

}
</style>
